<template>
  <div>
    <div class = "sousuo">
       <!-- 手机号: <i-input v-model="phone" placeholder="请输入..." style="width: 300px"></i-input>
        <i-button type="primary" shape="circle" icon="ios-search" @click="getListInfo(0)"></i-button> -->
        <br>
       当前列表><span v-if="this.status>0">已处理</span><span v-else>未处理</span>
        <br>
        <i-button type="info" size="small"  @click="getListInfo(1)">已处理</i-button>
        <i-button type="info" size="small"  @click="getListInfo(0)">未处理</i-button>
    </div>
    <Row class="body">
      <i-col span="1">编号</i-col>
      <i-col span="2">用户名</i-col>
      <i-col span="2">手机号</i-col>
      <i-col span="2">发卡行</i-col>
      <i-col span="4">卡号</i-col>
      <i-col span="2">想要提升的额度</i-col>
      <i-col span="2">信用卡额度</i-col>
      <i-col span="2">现可用额度</i-col>
      <i-col span="2">有效日期</i-col>
      <i-col span="4">申请时间</i-col>
      <i-col span="1">操作</i-col>
    </Row>

    <Row class="list" v-for="(item,index) of list" :key="index">
      <i-col span="1">{{index+1}}</i-col>
      <i-col span="2">{{item.userName===''?'-':item.userName}}&nbsp;</i-col>
      <i-col span="2">{{item.phone===''?'-':item.phone}}&nbsp;</i-col>
      <i-col span="2">{{item.bankName===''?'-':item.bankName}}&nbsp;</i-col>
      <i-col span="4">{{item.cardId===''?'-':item.cardId}}&nbsp;</i-col>
      <i-col span="2">{{item.wantMoney===''?'-':item.wantMoney}}&nbsp;</i-col>
      <i-col span="2">{{item.maxMoney===''?'-':item.maxMoney}}&nbsp;</i-col>
      <i-col span="2">{{item.currentMoney===''?'-':item.currentMoney}}&nbsp;</i-col>
      <i-col span="2">{{item.validData===''?'-':item.validData}}&nbsp;</i-col>
      <i-col span="4">{{item.updateTime===''?'-':item.updateTime}}&nbsp;</i-col>
      <i-col span="1">
        <i-button
          v-if="item.status==0"
          type="info"
          size="small"
          @click="async(item.id)"
        >处理</i-button>
        <!-- <i-button type="error" size="small"  @click="handleDelManager(item.userId,item.phone)">删除</i-button> -->
      </i-col>
    </Row>

      <div class="page">
        <Page :total="total" :page-size="pageSize" @on-change="handlePage"></Page>
      </div>

  </div>
</template>

<script>
import axios from "axios";
import { Modal } from "iview";
export default {
  name: "TxglList",
  data() {
    return {
      pageSize:10,
      page:1,
      total:0,
      list: [],
      modal6: false,
      loading: true,
      phone:'',//21312
      status:0,
    };
  },
  methods: {
    handlePage (res){
      console.log(res);
      var params = {
        "page": res,
        "pageSize": this.pageSize,
        "status": this.status //0，未处理  1，已处理
      };
      axios.post('/web/api/raise/list',params).then(this.getListInfoSucc)
    },
    getListInfo(status) {
      this.status = status;
      var params = {
        "page": this.page,
        "pageSize": this.pageSize,
        "status": this.status //0，未处理  1，已处理
      };
      axios.post("/web/api/raise/list",params).then(this.getListInfoSucc);
    },
    getListInfoSucc(res) {
      console.log("列表=====", res);
      this.list = res.data.date.list;
      this.total = res.data.date.total
    },
    handleUpdateManager(id) {
      axios
        .post("/web/api/raise/edit", {
          "id": id,
          "status":1
        })
        .then(this.updateInfoSucc);
    },
    updateInfoSucc(res) {
      console.log("修改", res);
      this.$Message.info(res.data.message);
      this.getListInfo(0);
    },
    async(id) {
      this.$Modal.confirm({
        title: "提示框",
        content:
          "<p>请确认该条提现信息已经完成提额处理？</p>",
        loading: true,
        onOk: () => {
          setTimeout(() => {
            this.$Modal.remove();
            this.handleUpdateManager(id);
          }, 2000);
        }
      });
    }
  },
  mounted() {
    this.getListInfo(0);
  }
};
</script>
<style lang="stylus" scoped>
.body {
  width: 100%;
  line-height: 3;
  font-size: 14px;
  color: #2680c4;
  background: #eff3fa;
  text-align: center;
}

.list {
  line-height: 3;
  font-size: 14px;
  text-align: center;
  color: #2680c4;
}

.sousuo {
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.page {
  width: 100%;
  margin-top: 2rem;
  text-align: center;
}
</style>

